package com.phy.gsjl.entity;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 回复信息实体类
 * 
 * @author curry
 *
 */
@Entity
@Table(name = "reply")
public class Reply {

	/**
	 * 回复信息ID，主键
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "r_id", nullable = false, unique = true)
	private Integer r_id;

	/**
	 * 回复信息ID
	 */
	@Column(name = "m_id", nullable = false)
	private Integer m_id;

	/**
	 * 回复人
	 */
	@Column(name = "username", nullable = false)
	private String username;

	/**
	 * 回复时间
	 */
	@Column(name = "r_time", nullable = false)
	private String r_time;

	/**
	 * 回复内容
	 */
	@Column(name = "r_details", nullable = false)
	private String r_details;

	public Reply() {

	}

	public Reply(Integer m_id, String username, String r_details) {
		this.m_id = m_id;
		this.username = username;
		this.r_time = new SimpleDateFormat("yyyy-MM-dd MM:mm:ss").format(new Date());
		this.r_details = r_details;
	}

	public Integer getR_id() {
		return r_id;
	}

	public void setR_id(Integer r_id) {
		this.r_id = r_id;
	}

	public Integer getM_id() {
		return m_id;
	}

	public void setM_id(Integer m_id) {
		this.m_id = m_id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getR_time() {
		return r_time;
	}

	public void setR_time(String r_time) {
		this.r_time = r_time;
	}

	public String getR_details() {
		return r_details;
	}

	public void setR_details(String r_details) {
		this.r_details = r_details;
	}

	@Override
	public String toString() {
		return "Reply [r_id=" + r_id + ", m_id=" + m_id + ", username=" + username + ", r_time=" + r_time
				+ ", r_details=" + r_details + "]";
	}

}
